﻿  <%@ page pageEncoding="UTF-8" %>
  <%@ page import="
  java.util.Date,
	java.util.*,
	javax.servlet.*,
	javax.servlet.http.*,
	com.wobaby.dao.*,
	com.wobaby.vo.*,
	java.text.SimpleDateFormat,
	com.wobaby.security.*
	"%>
<%--往messagecontent表里面插一条数据但是没在message表中把发送给多个接受者的数据插进去--%>	
<%
UserVO sender = (UserVO)request.getSession().getAttribute("UserVO");
UserManagement um = new UserManagement();
//UserVO senduser = um.lookupUserByID(300);
String receiverNames = new String(request.getParameter("divtxt").getBytes("ISO-8859-1"),"utf-8");//request.getParameter("divtxt");

String[] receiverNameArray = receiverNames.split(";");
List<UserVO> receivers = new ArrayList<UserVO>();
if(receiverNameArray!=null){
	for(int i = 0; i<receiverNameArray.length;i++){
		if(null!=receiverNameArray[i] && receiverNameArray[i].length()>=3){
			receiverNameArray[i] = receiverNameArray[i].substring(receiverNameArray[i].indexOf("<")+1,receiverNameArray[i].length()-1);
			receivers.add(um.lookupUserByUserName(receiverNameArray[i])); 
		} 
	}
}

String title = new String(request.getParameter("divtitle").getBytes("ISO-8859-1"),"utf-8"); //request.getParameter("divtitle");
String content = new String(request.getParameter("textarea").getBytes("ISO-8859-1"),"utf-8");//request.getParameter("textarea");

//String title="hello everyboby";
//String content="这是一个新的学期的开学，希望大家度过一个愉快的学习时光";

String type = "Notification";
//String RecieveID="101;103;105";
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
String date=dateFormat.format(new java.util.Date());


MessagerContentManagement mc = new MessagerContentManagement();

MessagerContentVO mcv = new MessagerContentVO(title,content,date,date,"1");

mc.addMessagerContent(mcv,sender,receivers);



 try
        {
           
        }
        catch(PermissionException pe)
        {
            
          
        }
 %>	
 <%=23424 %>>